<label for="team_name">Name:</label> <%= f.text_field :name %><br/>
<label for="team_full_name">Full name:</label> <%= f.text_field :full_name %><br/>
<label for="team_city">City:</label> <%= f.text_field :city %><br/>
<label for="team_foundation_li">Foundation:</label> <%= f.date_select :foundation, :start_year => 1880, :include_blank => true %><br/>
<label for="team_country">Country:</label> <%= f.text_field :country %><br/>
Stadium:
<select id="team_stadium_id" name="team[stadium_id]">
  <option value=""></option>
  <%= options_from_collection_for_select @stadiums, "id", "name", @team.stadium_id %>
</select>
<%= link_to_function "New" do |page|
  page["add_stadium"].toggle
  page["stadium_name"].activate
end %><br/>
<div id="add_stadium" style="display: none">
  Name: <%= text_field_tag "stadium_name", "", :onkeypress => "return ignoreEnter(event)", :name => "stadium[name]" %>
  <br/>
  <%= submit_to_remote "Create", "Create",
    :url => { :controller => :game, :action => :create_stadium_for_edit },
    :with => "Form.serializeElements([$('stadium_name')])",
    :confirm => "Are you sure you want to create a new stadium?",
    :update => { :success => :team_stadium_id },
    :failure => "alert('Could not insert stadium')" %>
</div>
<label for="logo">Logo:</label> <%= file_field_tag "logo" %><br/>
<label for="filter">Filter image background?</label> <%= check_box_tag "filter" %><br/> 

<%= javascript_tag <<EOF
function ignoreEnter(event) {
  if (event.keyCode == Event.KEY_RETURN) return false;
  return true;
}
EOF
%>
